
<?php
/**
 * Registration Form
 * This form would allow users of the system register with the system
 * 
 */

 class Form_Register extends Zend_Dojo_Form
 {
	public function __construct($options = null)
		{
		parent::__construct($options);
		Zend_Dojo::enableForm($this);
		$this->setName('Register');
		//$id = new Zend_Form_Element_Hidden('id');
		
		//User enters his First Name
		$firstName = new Zend_Dojo_Form_Element_ValidationTextBox('fname');
		$firstName->setLabel('FirstName')
		->setRequired(true)
		->addFilter('StripTags')
		->addFilter('StringTrim')
		->addValidator('NotEmpty');
	
		
		$LastName = new Zend_Dojo_Form_Element_ValidationTextBox('lname');
		$LastName->setLabel('LastName')
		->setRequired(true)
		->addFilter('StripTags')
		->addFilter('StringTrim')
		->addValidator('NotEmpty')
		->addErrorMessage("Please input your last name");
		
    
    	//Last Name --Dojo

		//User Enters email address
		$emailaddress = new Zend_Dojo_Form_Element_ValidationTextBox('email');
		$emailaddress->setLabel('Email: ')
					 ->setRequired(true)
					 ->addFilter('StripTags')
					 ->addFilter('StringTrim')
					 ->addValidator('NotEmpty');
					 
		/**
		 * User Account details
		 */
		$userName = new Zend_Dojo_Form_Element_ValidationTextBox('username');
		$userName->setLabel('UserName: ')
					 ->setRequired(true)
					 ->addFilter('StripTags')
					 ->addFilter('StringTrim')
					 ->addValidator('NotEmpty');
		
		$password = new Zend_Dojo_Form_Element_PasswordTextBox('password');
		$password->setLabel('Password: ')
					 ->setRequired(true)
					 ->addValidator('NotEmpty');	
		
		$password2 = new Zend_Dojo_Form_Element_PasswordTextBox('password2');
		$password2->setLabel('Retype password: ')
					 ->setRequired(true)
					 ->setInvalidMessage("Please Enter Password: ");
			

$combo = new Zend_Dojo_Form_Element_ComboBox('box');
		//Select school

$options = (array ("University of Maine" => "University of Maine", 
					"University of New Hampshire" => "University of New Hampshire", 
					"University of Vermont" => "University of Vermont",
					"University of Arizona" => "University of Arizona",
					"University of Conneticut" => "University of Conneticut",
					"University of Colorado at Boulder" => "University of Colorado at Boulder",
					"Arizona State University" => "Arizona State University"));
$school = new Zend_Dojo_Form_Element_ComboBox('school');
$school->setLabel('Select school');
$school->addMultiOptions($options);
$school->setAutocomplete(true);

/*
		$school = new Zend_Dojo_Form_ComboBox('school');
		$options = (array ("University of Maine" => "University of Maine", 
							"University of New Hampshire" => "University of New Hampshire", 
							"University of Vermont" => "University of Vermont"));
		$school->setMultiOptions($options)		 
			   ->setLabel('Select Present school:');
		*/
			   
		$submit = new Zend_Dojo_Form_Element_SubmitButton('submit');
		
		$this->addElements(array($firstName, $LastName, $emailaddress,$school, $userName, $password, $password2));
	    $this->addElement($submit);
		//$this->setAction('register');
		$this->setMethod('POST');
		}
}
 
